<template>
  <div>
    <el-dialog v-bind="$attrs" v-on="$listeners" title="报名记录" width="50%">
      <JADP-table :data="list">
        <el-table-column label="订单" prop="orderno"></el-table-column>
        <el-table-column label="学号" prop="stuno"></el-table-column>
        <el-table-column
          label="姓名"
          prop="stuname"
          width="70"
        ></el-table-column>
        <el-table-column label="单位" prop="company"></el-table-column>
        <el-table-column
          label="支付金额"
          prop="price"
          width="80"
        ></el-table-column>
        <el-table-column label="报名时间" prop="signtime"></el-table-column>
      </JADP-table>
      <pagination
        :total="total"
        :page.sync="listQuery.currentPage"
        :limit.sync="listQuery.pageSize"
        @pagination="initData(id)"
      />
      <div slot="footer">
        <!-- <el-button type="text" @click="$emit('update:visible', false)"
          >取消</el-button
        > -->
        <el-button
          @click="$emit('update:visible', false)"
          style="margin-right: 30px"
          >取消</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { getInfo } from "@/api/class";
export default {
  name: "",
  data() {
    return {
      total: 0,
      list: [],
      query: {
        clazzid: undefined,
      },
      listQuery: {
        currentPage: 1,
        pageSize: 20,
        sort: "desc",
        sidx: "",
      },
      id: "",
    };
  },
  methods: {
    async initData(id) {
      this.id = id;
      this.query.clazzid = id;
      let _query = {
        ...this.listQuery,
        ...this.query,
        organizeId:this.$store.getters.organizeId
      };
      let query = {};
      for (let key in _query) {
        if (Array.isArray(_query[key])) {
          query[key] = _query[key].join();
        } else {
          query[key] = _query[key];
        }
      }
      console.log(query, "qury");
      const { data } = await getInfo(query);
      this.list = data.list;
      this.total = data.pagination.total;
    },
  },
};
</script>
<style scoped lang="less"></style>
